package org.linloong.modules.apis.monitor.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 解析后的气象数据（存储dataArray与layout匹配结果）
 */
@Data
@TableName("t_weather_data_parsed")
@Schema(name = "WeatherDataParsed", description = "解析后的气象数据（dataArray与layout匹配结果）")
public class WeatherDataParsed {
    @TableId(type = IdType.ASSIGN_UUID)
    @Schema(description = "主键ID", example = "123e4567-e89b-12d3-a456-426614174000")
    private String id;

    @Schema(description = "关联的原始数据ID", example = "123e4567-e89b-12d3-a456-426614174001")
    private String rawDataId;

    @Schema(description = "设备ID", example = "ZW000001")
    private String deviceId;

    @Schema(description = "数据时间戳（与原始数据一致）", example = "1592271960000")
    private Long timestamp;

    @Schema(description = "传感器名称（如\"平均风向\"）", example = "平均风向")
    private String sensorName;

    @Schema(description = "传感器类型（如\"windDirection\"）", example = "windDirection")
    private String sensorType;

    @Schema(description = "解析后的值（原始值×k + b）", example = "185.00")
    private BigDecimal parsedValue;

    @Schema(description = "单位（如\"°\"）", example = "°")
    private String unit;

    @Schema(description = "传感器描述（如\"3米\"）", example = "3米")
    private String description;

    @Schema(description = "数据位置顺序（匹配dataArray索引，从0开始）", example = "0")
    private Integer serial;
    @Schema(description = "解析时间", example = "2024-06-01 08:00:00")
    private LocalDateTime parseTime;
}